
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>写评价</title>

    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/purchase_review.css">
</head>

<body>
<script src="../js/purchase_review.js"></script>
<div class="wrap">
    <div class="brand">
        <ul>
            <li><a href="javascript:;">${vo.product.productType}</a>></li>
            <li><a href="javascript:;">${vo.product.productSupportAge}</a>></li>
        </ul>
    </div>
    <div class="content">
        <div class="lef11">
            <div class="con1">
                <div class="con1-inner">
                    <p class="p1">${vo.product.productName}</p>
                    <div class="pj">
                        <div class="str"><span> </span><i>${vo.product.productPrice}</i></div>
                        <p>${vo.product.productMsg}</p>
                    </div>
                </div>
                <div class="lookbox">
                    <a href="javascript:;" class="look2">查看商家详情</a>
                </div>
            </div>
            <div class="con2">
                <div class="incon2">
                    <p style="margin-left: 50px">我要评价</p>
                    <ul>
                        <li>
                            <div class="rig">
                            </div>
                        </li>
                        <li>
                            <div class="lef">
                                <span>评价</span>
                            </div>
                            <div class="rig">
                                <div class="writebox">
                                        <textarea class="review_text" name=""  id="" cols="30"  rows="10">
                                        </textarea>

                                    <div class="bon">
                                        <img src="../images/evaluate_img/111.png" alt="">
                                        <span>15-2000个字</span>

                                    </div>
                                </div>
                            </div>
                        </li>
                        <li style="margin-top: 15px;">
                            <div class="lef">
                                <i>图片/视频</i>
                            </div>
                            <div class="rig22">
                                <p class="pa11">
                                    <input type="button" value="上传图片" class="pa11-img" onclick="openFile()">
                                    <input type="file" id="open" style="display: none">
                                    <i class="pa11-text">单张图片不超过10MB，尺寸不小于300*300px，支持jpg、png和bmp格式</i></p>
                            </div>
                        </li>
                    </ul>
                    <ul>
                        <li>
                            <div class="lef">

                            </div>
                            <div class="rig">
                                <p class="pj">
                                    评价和打分都将是其他网友的参考依据，并影响该商户评价。请发布真实、客观的本人消费体验评价。如您收到威逼、利诱如优惠等干扰而发布的评价或并非本人体验的虚假/恶意评价，则评价视为违规，同时影响您的信誉度。
                                </p>
                            </div>
                        </li>
                        <li>
                            <div class="lef">

                            </div>
                            <div class="rig ruy">
                                <div class="sav">

                                    <a href="javascript:;" class="saveReviewBtn abc2">发表评价</a>
                                </div>
                                <div class="ti">评价已经在20：47：37自动保存</div>
                            </div>
                        </li>
                    </ul>
                    </ul>
                </div>
            </div>

        </div>
    </div>
</div>

<%--<script src="../js/purchase_review.js"></script>--%>
<script>

    /*submit new review */
    $(".saveReviewBtn").click(function (){
        var proId='${vo.product.productId}';
        var reviewText = $(".review_text").val().trim();
        console.log("productId:"+productId);
        console.log("reviewText:"+reviewText);

        var data={
            productId:proId,
            reviewText:reviewText,
        }

        var url='${pageContext.request.contextPath}'+"/review";
        console.log("url:"+url);
        console.log("data:"+data);

        $.post(
            url,
            data,
            function (result){
                console.log("result:"+result);
                location.href='${pageContext.request.contextPath}'+"/product/"+productId;
            },
            "json"
        )
    })
</script>



</body>
</html>















